Add 48 C++ MSTest tests for LightSwitch#46934
Open
crutkas wants to merge 5 commits intomicrosoft:mainfrom
Open
Add 48 C++ MSTest tests for LightSwitch#46934crutkas wants to merge 5 commits intomicrosoft:mainfrom
crutkas wants to merge 5 commits intomicrosoft:mainfrom
Conversation
ShouldBeLight schedule logic with fixed times and midnight wraparound, sunrise/sunset daylight-duration validation (timezone-wrap safe), ScheduleMode enum serialization round-trip, and config defaults. Split from PR microsoft#46905 (5/7) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
DHowett
requested changes
Apr 12, 2026
Member
DHowett
left a comment
There was a problem hiding this comment.
An engineer--not a computer--needs to verify each of these test cases to ensure that they are worthwhile and on-target.
- Created LightSwitchTypes.h with ScheduleMode, ToString/FromString, LightSwitchConfig - Modified LightSwitchSettings.h to include LightSwitchTypes.h - Removed copy-pasted definitions from test file (20 tests now test real code) - Extracted CoordinatesAreValid to LightSwitchUtils.h as free function - Added 6 CoordinatesAreValid tests - Added 2 polar-region SunCalc edge case tests (documenting -1 sentinel bug) - Added deep comments to all 56 test methods Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
48 new TEST_METHODs covering LightSwitch:
Split from #46905 (5/7) — see that PR for full context.
Files Changed (7)
src/modules/LightSwitch/UnitTests/LightSwitchTests.cpp(new)src/modules/LightSwitch/UnitTests/UnitTests-LightSwitch.vcxproj(new)src/modules/LightSwitch/UnitTests/UnitTests-LightSwitch.vcxproj.filters(new)src/modules/LightSwitch/UnitTests/pch.cpp(new)src/modules/LightSwitch/UnitTests/pch.h(new)PowerToys.slnx(modified — +1 project ref in /modules/LightSwitch/Tests/).github/actions/spell-check/expect.txt(modified)